*, *::before, *::after {
  box-sizing: border-box;

  --background-color: #e3e3e3;
  --border-size: 2px;
  --accent-color: #0af;
  --border-radius: 5px;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

.btn{
  border: none;
  background: var(--background-color);
  border-radius: var(--border-radius);
  padding: 10px;
  outline: none;
  position: relative;
  cursor: pointer;
  margin: 10px;
}

.btn.btn-border-pop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  border-radius: var(--border-radius);
  border: var(--border-size) solid var(--background-color);
  transition: top, left, right, bottom, 100ms ease-in-out
}

/* 负数向外移动2倍 */
.btn.btn-border-pop:hover:before,
.btn.btn-border-pop:focus::before {
  top: calc(var(--border-size) * -2);
  left: calc(var(--border-size) * -2);
  right: calc(var(--border-size) * -2);
  bottom: calc(var(--border-size) * -2);
}

.btn.btn-background-slide{
  transition: color 300ms ease-in-out;
  z-index: 1;
}

.btn.btn-background-slide::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  border-radius: var(--border-radius);
  background-color: var(--accent-color);
  transition: transform 300ms ease-in-out;
  transform:  scaleX(0);
  transform-origin: left;
}

.btn.btn-background-slide:hover:before,
.btn.btn-background-slide:focus:before {
  transform: scaleX(1);
}

.btn.btn-background-slide:hover,
.btn.btn-background-slide:focus {
  color:#FFF;
}

.btn.btn-background-circle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background-color: var(--background-color);
  border-radius: 50%;
  transition: transform 500ms ease-in-out;
  transform: scale(1.5);
}

.btn.btn-background-circle:hover:before,
.btn.btn-background-circle:focus:before {
  transform: scale(0);
}

.btn.btn-background-circle{
  z-index: 1;
  overflow: hidden;
  background-color: var(--accent-color);
  transition: color 500ms ease-in-out;
}

.btn.btn-background-circle:hover,
.btn.btn-background-circle:focus {
  color: #FFF
}

.btn.btn-background-underline::before {
  content: '';
  position: absolute;
  top: 33px;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--border-size);
  background-color: var(--accent-color);
  transition: transform 300ms ease-in-out;
  transform: scaleX(0);
}

.btn.btn-background-underline:hover:before,
.btn.btn-background-underline:focus:before{
  transform: scaleX(1);
}